<%@page import="com.google.appengine.api.users.UserService"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>
<%
UserService userService = UserServiceFactory.getUserService();
String myUri = request.getAttribute("javax.servlet.forward.request_uri").toString(); 
//String logoutURL = userService.createLogoutURL(myUri);
//String loginURL = userService.createLoginURL(myUri); 
String logoutURL = "/signout.html";
String loginURL = "/spring_security_login";

if (request.getUserPrincipal() != null) {
%>
<!-- User logged in -->
	<%=request.getUserPrincipal().getName()%> |
	<a href="/account.html" class="sgnMenuItem">My Account</a> | 
	<a href="<%=logoutURL%>" class="sgnMenuItem">Sign Out</a> |
<% 
} else {
%>
<!-- User not logged in -->
	<a href="/register.html" class="sgnMenuItem">Join</a> |
	<a href="<%=loginURL%>" class="sgnMenuItem">Sign In</a> |
<%
}
%> 
	<a href="/help.html" class="sgnMenuItem">Help</a>